/*
2021-11-2
https://www.acwing.com/problem/content/4006/
*/ 
#include<cstring>
#include<iostream>
#include<algorithm>
#include<cmath>

using namespace std;
int a[1005];

int main()
{
    int n;
    cin>>n;
    int ans;
    for(int i=0;i<n;i++)
    {
        cin>>a[i];
    }
    sort(a,a+n);
    
    for(int i=n-1;i>=0;i--)
    {
        if((int)sqrt(a[i])*(int)sqrt(a[i])!=a[i])
        {
            ans=a[i];
            break;
        }
    }
    cout<<ans<<endl;
    return 0;
}
